import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from "@/views/LoginView.vue";
import ListView from "@/views/ListView.vue";
import MenuView from "@/views/MenuView.vue";
import CartView from "@/views/CartView.vue";
import OrderView from "@/views/OrderView.vue";
import TypeView from "@/views/TypeView.vue";

Vue.use(VueRouter)

const routes = [
  ,
  {
    path: '/callback',
    name: 'callback',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/CallBackView.vue')
  },{
    path: '/',
    name: 'menu',
    component: MenuView,
    children:[
      ,{
        path: '/list',
        name: 'list',
        component: ListView
      },{
        path: '/login',
        name: 'login',
        component: LoginView
      },{
        path: '/cart',
        name: 'cart',
        component: CartView
      },{
        path: '/order',
        name: 'order',
        component: OrderView
      },{
        path: '/types',
        name: 'types',
        component: TypeView
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
